//
//  MHRecentMessageTableViewCell.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/5/30.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHMessageAttributeCell.h"
#import "MHRecentMessageItemViewModel.h"
#import "NSMutableAttributedString+MHMoment.h"
#import "MHPicture.h"
#import "MHCustomItemViewModel.h"
#import "MHAttributeModel.h"

@interface MHMessageAttributeCell()
//@property(nonatomic,strong) MHAskItemViewModel *viewModel;
@end

@implementation MHMessageAttributeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.contentLable.font = MHMomentContentFont;
    self.createTimeLabel.font = MHRegularFont_12;
    self.nameLable.font = MHRegularFont_14;
    self.attrImage.clipsToBounds = YES;
    
}


-(void)bindViewModel:(MHCustomItemViewModel *)viewModel
{
    MHAttributeModel *model = viewModel.model;
    self.nameLable.text = model.userName;
    self.createTimeLabel.text = model.transformTime;
    [self.avterImageView yy_setImageWithURL:[NSURL URLWithString:model.allUserFace] placeholder:MHDefaultAvatar(MHDefaultAvatarTypeDefualt)];
    self.attrImage.hidden = (model.recentCover.length <= 0);
    if(model.recentCover.length >0)
    {
        [self.attrImage yy_setImageWithURL:[NSURL URLWithString:model.recentCover] placeholder:MHDefaultAvatar(MHDefaultAvatarTypeDefualt)];
    }
    self.contentLable.text = @"赞了我";
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
